

*************************************Table A24**************************************************
*************************************Table A24**************************************************
*************************************Table A24**************************************************
*--------------------------------------------------------
*Notice The following code needs to be run in STATA 16.
*--------------------------------------------------------
use "D:\Nanjing\2019\pollution2\submission\files for submission\data\tables_mechanism", clear
replace indc_e=0 if indc_e==.
replace indc_abt=0 if indc_abt==.
*replace cic_so2=0 if cic_so2==.

replace exp_e=exp_dummy2*indc_e
replace exp_abt=exp_dummy2*indc_abt
replace exp_index1=exp_dummy2*cic_so2

capture drop IV1 
capture drop IV2
capture drop  IV3 
capture drop IV4

gen IV1=exp_dummy_lag *RD_d
gen IV2=exp_dummy_lag *coal_share_lag
gen IV3=exp_dummy_lag *lnv_lag
gen IV4=exp_dummy_lag *dirty_so2
gen IV5=exp_dummy_lag *indc_e
gen IV6=exp_dummy_lag *indc_abt
gen IV7=exp_dummy_lag*cic_so2

rename exp_dummy2 Export
rename so2_new1 Abatement_so2
rename dust_new1 Abatement_dust
rename lnv_lag vintage
rename exp_v exp_vintage
rename tfp_acf_new Productivity
rename coal_share_lag NRG
rename exp_coal exp_NRG
rename dirty_so2 Mix
rename exp_so2 exp_mix
rename RD_d RD
rename lnkl_lag lnKL
rename lntariff Tariff
rename treatment_tfp tariff_prod
rename treatment_so2 ventilation_prod
rename cic_so2 Demand


* 24.1. Column 1
set matsize 10000
ivlasso lnso2 Productivity Tariff lnKL lnso2_ini i.cic i.prov i.year i.ownerships (Export  Abatement_so2=tariff_prod ventilation_prod  ventilation ) ( RD NRG vintage Mix indc_e indc_abt Demand), partial(tariff_prod ventilation_prod  ventilation)


* 24.2. Column 2
ivlasso lnso2 Productivity Tariff lnKL lnso2_ini i.cic i.prov i.year i.ownerships (Export  Abatement_so2 exp_rd exp_NRG exp_vintage exp_mix  exp_e exp_abt exp_index1=tariff_prod   ventilation_prod  ventilation  exp_dummy_lag IV1 IV2 IV3 IV4 IV5 IV6 IV7) ( RD NRG vintage Mix indc_e indc_abt Demand), partial(tariff_prod   ventilation_prod    ventilation exp_dummy_lag IV1 IV2 IV3 IV4 IV5 IV6 IV7) 



* 24.3. Column 3
ivlasso lndust Productivity Tariff lnKL lndust_ini i.cic i.prov i.year i.ownerships (Export  Abatement_dust=tariff_prod ventilation_prod  ventilation ) ( RD NRG vintage Mix indc_e indc_abt Demand), partial(tariff_prod ventilation_prod  ventilation)



* 24.4. Column 4
replace  IV4=exp_dummy_lag *dirty_dust
ivlasso lndust Productivity Tariff lnKL lndust_ini i.cic i.prov i.year i.ownerships (Export  Abatement_dust exp_rd exp_NRG exp_vintage exp_mix  exp_e exp_abt exp_index1=tariff_prod   ventilation_prod  ventilation  exp_dummy_lag IV1 IV2 IV3 IV4 IV5 IV6 IV7) ( RD NRG vintage Mix indc_e indc_abt Demand), partial(tariff_prod   ventilation_prod    ventilation exp_dummy_lag IV1 IV2 IV3 IV4 IV5 IV6 IV7) 

